home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / !Interfaces / Universal Interfaces 2.0a1 / PInterfaces / ConditionalMacros.p < prev    next >
Encoding:
Text File  |  1994-07-17  |  4.4 KB  |  145 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ConditionalMacros.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a1.  ETO #15, MPW prerelease.  Sunday, July 17, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT ConditionalMacros;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __CONDITIONALMACROS__}
  27. {$SETC __CONDITIONALMACROS__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ConditionalMacrosIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$PUSH}
  35. {$ALIGN MAC68K}
  36. {$LibExport+}
  37. {
  38.     This file sets up the following compiler independent conditionals:
  39.     
  40.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  41.     GENERATING68K            - Compiler is generating 68k family instructions
  42.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  43.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  44.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  45.     
  46.     SystemSevenFiveOrLater    - Compiled code will only be run on a System 7.5 or later Macintosh
  47.     SystemSevenOrLater        - Compiled code will only be run on a System 7.0 or later Macintosh
  48.     SystemSixOrLater        - Compiled code will only be run on a System 6.0 or later Macintosh
  49.                               A developer should set the appropriate flag on the compiler command-
  50.                               line or in a file processed before this file.  This will allow the
  51.                               certain optimizations to be made which can result in smaller, faster
  52.                               applications.
  53.     
  54.     CGLUESUPPORTED            - Interface library will support "C glue" functions (function names
  55.                               are: all lowercase, use C strings instead of pascal strings, use 
  56.                               Point* instead of Point).
  57.  
  58.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  59.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  60.                               are now more sensitive to change because CFM binds by name.  In the 
  61.                               past, system routine names were compiled out to just an A-Trap.  
  62.                               Macros have been added that each map an old name to its new name.  
  63.                               This allows old routine names to be used in existing source files,
  64.                               but the macros only work if OLDROUTINENAMES is true.  This support
  65.                               will be removed in the near future.  Thus, all source code should 
  66.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  67.                               to see if your code has any old names left in it.
  68.     
  69.     
  70.     There are some invariants among the conditionals:
  71.     
  72.     GENERATINGPOWERPC != GENERATING68K
  73.     GENERATING68881 => GENERATING68K
  74.     GENERATINGPOWERPC => GENERATINGCFM
  75.     GENERATINGPOWERPC => CFMSYSTEMCALLS
  76.     CFMSYSTEMCALLS => GENERATINGCFM
  77.     GENERATINGPOWERPC => SystemSevenOrLater
  78.     SystemSevenFiveOrLater => SystemSevenOrLater
  79.     SystemSevenOrLater => SystemSixOrLater
  80.     
  81.     
  82. }
  83. {$IFC UNDEFINED LSPWRP }
  84. {$SETC LSPWRP := 0}
  85. {$ENDC}
  86. {$IFC UNDEFINED LSP68K }
  87. {$SETC LSP68K := NOT LSPWRP}
  88. {$ENDC}
  89. {$SETC GENERATINGPOWERPC := LSPWRP}
  90. {$SETC GENERATING68K := LSP68K}
  91. {$IFC GENERATING68K  & OPTION(mc68881) }
  92. {$SETC GENERATING68881 := 001}
  93. {$ENDC}
  94. {$IFC UNDEFINED GENERATING68881 }
  95. {$SETC GENERATING68881 := 0}
  96. {$ENDC}
  97. {$IFC GENERATINGPOWERPC }
  98. {$SETC CFMSYSTEMCALLS := 1}
  99. {$SETC GENERATINGCFM := 1}
  100. {$ENDC}
  101. {$IFC UNDEFINED GENERATINGCFM }
  102.  {$IFC UNDEFINED __CFM68K__ }
  103. {$SETC GENERATINGCFM := 0}
  104. {$SETC CFMSYSTEMCALLS := 0}
  105.  {$ELSEC}
  106. {$SETC GENERATINGCFM := 1}
  107. {$SETC CFMSYSTEMCALLS := 1}
  108.  {$ENDC}
  109. {$ENDC}
  110. {$IFC UNDEFINED CFMSYSTEMCALLS }
  111. {$SETC CFMSYSTEMCALLS := 0}
  112. {$ENDC}
  113. {$IFC UNDEFINED SystemSevenFiveOrLater }
  114. {$SETC SystemSevenFiveOrLater := 0}
  115. {$ENDC}
  116. {$IFC UNDEFINED SystemSevenOrLater }
  117.  {$IFC GENERATINGPOWERPC  | SystemSevenFiveOrLater }
  118. {$SETC SystemSevenOrLater := 1}
  119.  {$ELSEC}
  120. {$SETC SystemSevenOrLater := 0}
  121.  {$ENDC}
  122. {$ENDC}
  123. {$IFC UNDEFINED SystemSixOrLater }
  124. {$SETC SystemSixOrLater := SystemSevenOrLater}
  125. {$ENDC}
  126. {$IFC UNDEFINED OLDROUTINENAMES }
  127. {$SETC OLDROUTINENAMES := 1}
  128. {$ENDC}
  129. {$IFC OLDROUTINENAMES }
  130. {$SETC USES68KINLINES := GENERATING68K}
  131. {$SETC USESCODEFRAGMENTS := GENERATINGCFM}
  132. {$SETC USESROUTINEDESCRIPTORS := GENERATINGCFM}
  133. {$ENDC}
  134.  
  135. {$ALIGN RESET}
  136. {$POP}
  137.  
  138. {$SETC UsingIncludes := ConditionalMacrosIncludes}
  139.  
  140. {$ENDC} {__CONDITIONALMACROS__}
  141.  
  142. {$IFC NOT UsingIncludes}
  143.  END.
  144. {$ENDC}
  145.